import { myRequest,otherRequest } from '@/utils/http.js'
import api from './index.js'

// 获取账号下的所有设备
export const appletDeviceList =(header,params={})=>otherRequest({url:api.device.list,dataType:'application/x-www-form-urlencoded',header,params})
export const appletDeviceList2 =(header,params={})=>otherRequest({url:api.device.list2,dataType:'application/x-www-form-urlencoded',header,params})
// 获取账号下分享得所有设备
export const shareDeviceList = (header,params={})=>otherRequest({url:api.device.list3,dataType:'application/x-www-form-urlencoded',header,params})
// 能力集查询
export const AsMsgQ = (params) =>  {
    return new Promise(resolve => {
        resolve(myRequest({url:api.asMsgQ,params,DEFAULTURL:true,type:2,ISTOKEN:true}))
    })

}
// 订单列表
export const getOrderList =(params) => myRequest({url:api.order.list,params})
// 订单详情  orderId 订单id
export const getOrderDetail =(params) => myRequest({url:api.order.detail,params})
// 删除订单  orderId 订单id
export const getOrderDelete =(params) => myRequest({url:api.order.delete,params})
//优惠券列表
export const CouponList = (params) => myRequest({url:api.coupon,params})
// 套餐卡二维码查询
export const packageCardQuery = (params) => myRequest({url:api.packageCard.qrCardQuery,params})
// 套餐卡二维码使用
export const packageCardApply = (params) => myRequest({url:api.packageCard.qrCardApply,params})
export const RequestRefund = (params) => myRequest({url:api.order.requestRefund, params})
// 用户token登录
export const getLogin =(params) => myRequest({url:api.login,params,type:1,ISTOKEN:true})
// 获取设备令牌  deviceId 设备id(也就是序列号)
export const getDeviceToken =(params) => myRequest({url:api.deviceToken,params})

export const payRequestApplet =(params) => myRequest({url:api.order.pay,params})
// 关联手机号列表
export const VoLTE_PhoneList =(type,token) => myRequest({url:api.volet.mormal+type+'GetInfo/'+token,DEFAULTURL:true,type:3,ISTOKEN:true})
// 通话历史记录
export const VoLTE_History =(type,token,params) => myRequest({url:api.volet.mormal+type+'Query/'+token,params,DEFAULTURL:true,type:3,ISTOKEN:true})
// 设置关联手机号
export const VoLTE_SetPhone =(type,token,params) => myRequest({url:api.volet.mormal+type+'SetPhones/'+token,params,DEFAULTURL:true,type:3,ISTOKEN:true})
// 报警类型
export const VoLTE_AlarmType =(type,token,params) => myRequest({url:api.volet.mormal+type+'SetAlarmType/'+token,params,DEFAULTURL:true,type:3,ISTOKEN:true})
// 已购买信息
export const getMeBuy =(params) => myRequest({url:api.buy.me,params})
// 套餐列表
export const getGoods =(params) => myRequest({url:api.buy.goods,params})
// 购买价格计算
export const getBuy =(params) => myRequest({url:api.buy.calculation,params})
// 下订单
export const getPlaceOrder =(params) => myRequest({url:api.buy.placeOrder,params})
// 订单状态查询
export const getOrderStatus =(params) => myRequest({url:api.buy.status,params})
// 支付类型
export const getPayType =(params) => myRequest({url:api.buy.payType,params})
// 购买须知
export const getPurchaseNotes =(params) => myRequest({url:api.buy.PurchaseNotes,params})
// 获取云服务轮播图
export const getBossBannerList = (params) => myRequest({url:api.buy.banner,params})
// 获取算法超市
export const getBossAlgorithmRecommendation = (params) => myRequest({url:api.buy.bossAlgorithmRecommendation,params})